﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SiGeSIB.Data.Management;
using SiGeSIB.Business.Impl;

namespace SiGeSIB.Services.Impll.Providers
{
	public class ManagementServices : IManagementServicesProvider
	{
		public ManagementServices()
		{
			_Controller = new ManagementController();
		}

		private ManagementController _Controller;

		#region IManagementServicesProvider Members

		public int InsertContributor(Contributor contributor)
		{
			return _Controller.InsertContributor(contributor);
		}
		public void UpdateContributor(Contributor contributor)
		{
			_Controller.UptateContributor(contributor);
		}
		public void RemoveContributor(int id)
		{
			_Controller.RemoveContributor(id);
		}

		public Contributor GetContributor(int id)
		{
			List<Contributor> contributors = GetContributors(new int[] { id });

			return contributors != null && contributors.Count == 1 ? contributors[0] : null;
		}
		public List<Contributor> GetContributors()
		{
			return _Controller.GetContributors();
		}
		public List<Contributor> GetContributors(int[] ids)
		{
			return _Controller.GetContributors(ids);
		}
		public List<Contributor> GetContributors(EContributorType type)
		{
			return _Controller.GetContributors(type);
		}

		public Dictionary<string, Address> GetAddresses()
		{
			return _Controller.GetAddresses();
		}
		#endregion
	}
}
